{{define "Title"}}不良统计{{end}}
{{define "Content"}}

<script type=text/javascript src="/js/calendar.js"></script>
<script type=text/javascript src="/js/tablestyle.js"></script>

<div class="container-fluid">
<form class="form-horizontal" action="/failstatistics" method="POST">
  <fieldset>
    <legend><b>不良统计</b></legend>
    {{if .error}}<div class="alert alert-error"><b>错误: </b>{{.error | html}}</div>
    {{end}}
    <div class="control-group">
      <label class="control-label">开始时间&nbsp;</label>
      <div class="control">
        <input class="input-large" id="fromdate" name="fromdate" style="background-color: #FFFFD0" onfocus="setday(this);" size="20"> <b style="color: red">*</b>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label">结束时间&nbsp;</label>
      <div class="control">
        <input class="input-large" id="todate" name="todate" style="background-color: #FFFFD0" onfocus="setday(this);" size="20"> <b style="color: red">*</b>
      </div>
    </div>
    <div class="form-actions">
      <button type="submit" class="btn btn-primary">查询</button>
    </div>
  </fieldset>
</form>
</div>

{{if .failstatis}}
<div class="control-group">
  <label class="control-label">查询的日期范围: <b>{{.begindate | html}} - {{.enddate | html}}</b></label>
</div>
<div class="content-box">
  <div class="content-box-content">
    <table id="tbl_ls" border="1" cellspacing="0" cellpadding="0">
      <thead>
        <tr>
          <th>不良描述</th>
          <th>不良次数</th>
        </tr>  
      </thead>

      <tbody>
        {{$bdate := .begindate}}
        {{$edate := .enddate}}
        {{range .failstatis}}        
        <tr>
          <td id="fsta_tis" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Value1 | html}}</td>
          <td id="fsta_num" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px"><a href="/querystatis?fdes={{.Value1 | html}}&bdate={{$bdate | html}}&edate={{$edate | html}}&nm={{.Value2 | html}}">{{.Value2 | html}}</a></td>
        </tr>
        {{end}}
      </tbody>      
    </table>
  </div>
</div>
{{end}}

{{end}}